package com.ahut.gsmcommon.common.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @Author gan.sumin@mail.com
 * @data 2018/6/22/14:21
 * @description
 */
@Component
public class RedisUtil {


    private static RedisTemplate redisTemplate;

    @Autowired
    public RedisUtil(RedisTemplate redisTemplate){
        RedisUtil.redisTemplate = redisTemplate;
    }
    @Autowired
    private  StringRedisTemplate stringRedisTemplate;
    public static void saveMap(){
        LinkedHashMap<String,String> map = new LinkedHashMap<>();
        map.put("颖","l");
        map.put("琴","2");
        map.put("静","3");
        map.put("friend","4");
        redisTemplate.opsForHash().putAll("map",map);
    }
}
